﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AsyncUnitTest
{
    public class MyTest5
    {
        public static void Go()
        {
            DemoAsync(0).Wait();
        }

        public static Task DemoAsync(int i)
        {
            var task = i switch
            {
                0 => Task.FromResult(0),
                1 => Task.Delay(100),
                _ => Task.CompletedTask
            };
            return task;
        }
    }
}
